<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑两新组织架构信息</title>
<link href="/djzx/css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/djzx/js/jquery-1.8.1.min.js"></script>
<script language="JavaScript" type="text/javascript" src="/djzx/js/backPage/clientSideApp.js"></script>
<script language="javascript">

function goback(){
	window.location.href="/djzx/LXOrgStructureAction!getOrgStructureListForPage.action";
}

function updateOrgStructure(){
	var timeKey = $.trim($('#timeKey').val());
	var generalBranch = $.trim($('#generalBranch').val());
	var branch = $.trim($('#branch').val());
	
	if(generalBranch=="" && branch==""){
		alert("总支部和分支部不能都为空");
		return;
	}
	
	var fd = new FormData();
	fd.append('orgStructure.timeKey',timeKey);
	fd.append('orgStructure.generalBranch',generalBranch);
	fd.append('orgStructure.branch',branch);
	
	$.ajax({
	    url:"${pageContext.request.contextPath}/LXOrgStructureAction!updateOrgStructure.action",
	    type:"POST",
	    data:fd,
	    dataType: "json", 
	    contentType: false, //必须
	    processData: false, //必须
	    success:function(data){
	    	alert(data.message);
			if(data.success){
				location.href="/djzx/LXOrgStructureAction!getOrgStructureListForPage.action";
			}
	    }
	}); 
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="25" align="center" valign="bottom" class="td06"><table width="98%" border="0" cellspacing="3" cellpadding="0">
      <tr>
        <td width="15"><img src="/djzx/images/index_32.gif" width="9" height="9"></td>
        <td valign="bottom" class="title">编辑组织架构</td>
      </tr>
    </table></td>
  </tr>
</table>
<br>
<input type="hidden" name="timeKey" id="timeKey" value="${orgStructure.timeKey }" />
<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="120" height="24" class="td_form01">总支部</td>
        <td nowrap class=td_form02>
        	<input type="text" name="generalBranch" id="generalBranch" size="30" value="${orgStructure.generalBranch }" />
        </td>
        <td width="120" class="td_form01">分支部</td>
        <td nowrap class=td_form02>
        	<input type="text" name="branch" id="branch" size="30" value="${orgStructure.branch }" />
        </td>
      </tr>
</table>
<br>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><input name="Submit2" type="submit" class="buttonface" value="  保存  " onClick="updateOrgStructure()">
    <input name="Submit" type="submit" class="buttonface" value="  返回  "  onClick="goback()"></td>
  </tr>
</table>
<br>
</body>
</html>